import java.util.concurrent.BlockingQueue;

public class BlockingQueueEnqueuer implements Runnable {
	BlockingQueue<Integer> q;
	public BlockingQueueEnqueuer(BlockingQueue<Integer> q) {
		this.q = q;
	}
	@Override
	public void run() {
		for(int i = 0; i < 50; i++) {
			System.out.println("putting " + i);
			try {
				q.put(i);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			System.out.println("put");
		}
	}
}
